<template lang="pug">
  table(class='m-Info')
    tr
      td 参数名
      td 描述
      td 值
    tr(v-for='(item,i) in data')
      td(v-if="!item.wholeRow") {{ item.key }}
      td(v-if="!item.wholeRow" )
        div(v-for="desc in item.description") {{filtersEmpty(desc)}}
      td(v-if="!item.wholeRow")
        div(v-if="item.value.length == 0") --
        div(v-else v-for="val in item.value") {{filtersEmpty(val)}}
      td(v-if="item.wholeRow" class="title" colspan="3")
        div(v-if="!active") {{item.description && item.description[0] }}
        .small-title(v-else) {{item.description && item.description[0] }}
</template>
<script>
import { isEmpty } from '@/utils/index'
export default {
  props: {
    data: {
      type: Array,
      default: () => []
    },
    active: Boolean
  },
  methods: {
    filtersEmpty (val) {
      return isEmpty(val)
    }
  }
}
</script>
<style lang="stylus" scoped>
.m-Info
  width 100%
  tr
    &:nth-of-type(1)
      background: #f7fafd
    td
      border: 1px solid #dee6eb;
      padding: 12px;
      width 33.3%
      vertical-align:middle;
      line-height 24px
      word-break break-all
      &.title
        color #1f60bd
  .small-title
    border-left 2px solid #4c80ca
    text-indent 8px
</style>
